# coding=utf-8
from dataclasses import dataclass, field
from typing import ClassVar


@dataclass
class Player:
    name: str
    postion: str
    age: int
    sex: str = field(default="man", repr=False)
    # msg: str = field(default="")
    # 创建空对象
    msg: str = field(default_factory=str)
    # 类变量（类属性）
    country: ClassVar[str]


# 创建实例对象
p = Player("jhon", "beijing", 21)
print(p)
Player.country = "China"
print("类属性：", Player.country)
